<?php
/**
 * Created by PhpStorm.
 * User: yellow
 * Date: 2019/8/5
 * Time: 16:47
 */

namespace app\admin\controller;


use app\admin\logic\TravelAgencyLogic;
use think\facade\Request;

class TravelAgency extends Base
{

    private $travelAgencyLogic;

    public function __construct()
    {
        parent::__construct();
        $this->travelAgencyLogic = new TravelAgencyLogic();
    }

    public function index(){
        return view();
    }

    public function ajaxIndex(){
        $tempWhere = Request::request();
        $res = $this->travelAgencyLogic->travelList($tempWhere, self::$nowPage);
        return json($res);
    }

    public function add(){
        $act = "edit";
        $id = Request::get('id');
        if ($id){
            $travelInfo = $this->travelAgencyLogic->travelInfo($id);
            $this->assign('info', $travelInfo['data']);
        }
        $this->assign('act', $act);
        return view();
    }

}